package avicit.bdp.dgs.mdm.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import avicit.platform6.core.properties.PlatformConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

/**
 * @金航数码科技有限责任公司
 * @作者：${tableInfo.classCreator}
 * @邮箱：${tableInfo.classMailbox}
 * @创建时间： 2023-12-06 11:02
 * @类说明：
 * @修改记录：
 */
@ApiModel(value = "MdataChangeDTO", description = "主数据变更明细表")
@Table(name = "bdp_dgs_mdata_change")
public class MdataChangeDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @LogField
    @ApiModelProperty(value = "主键", name = "id")
    @FieldRemark(column = "id", field = "id", name = "主键")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    /**
     * 主数据ID
     */
    @LogField
    @ApiModelProperty(value = "主数据ID", name = "mdataId")
    @FieldRemark(column = "mdata_id", field = "mdataId", name = "主数据ID")
    private String mdataId;

    /**
     * 操作类型，1-新增，2-修改，3-删除
     */
    @LogField
    @ApiModelProperty(value = "操作类型", name = "operType")
    @FieldRemark(column = "oper_type", field = "operType", name = "操作类型")
    private Integer operType;

    /**
     * 操作时间
     */
    @LogField
    @ApiModelProperty(value = "操作时间", name = "operTime")
    @FieldRemark(column = "oper_time", field = "operTime", name = "操作时间")
    private Date operTime;

    /**
     * 数据详情
     */
    @LogField
    @ApiModelProperty(value = "数据详情", name = "data")
    @FieldRemark(column = "data", field = "data", name = "数据详情")
    private String data;

    @Transient
    private String monitorId;

    public String getMonitorId() {
        return monitorId;
    }

    public void setMonitorId(String monitorId) {
        this.monitorId = monitorId;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getMdataId() {
        return mdataId;
    }

    public void setMdataId(String mdataId) {
        this.mdataId = mdataId;
    }

    public Integer getOperType() {
        return operType;
    }

    public void setOperType(Integer operType) {
        this.operType = operType;
    }

    public Date getOperTime() {
        return operTime;
    }

    public void setOperTime(Date operTime) {
        this.operTime = operTime;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public String getLogFormName() {
        if (StringUtils.isEmpty(super.logFormName)) {
            return "bdp_dgs_mdata_change";
        } else {
            return super.logFormName;
        }
    }

    public String getLogTitle() {
        if (StringUtils.isEmpty(super.logTitle)) {
            return "bdp_dgs_mdata_change";
        } else {
            return super.logTitle;
        }
    }

    public PlatformConstant.LogType getLogType() {
        if (super.logType == null) {
            return PlatformConstant.LogType.module_operate;
        } else {
            return super.logType;
        }
    }

}
